#include <stdio.h>
#include <string.h>

int main() {
	char s1[] = "hello";
	char *ps = "world";
	char s2[100];
	
	printf("s1 = %s, ps = %s\n", s1, ps);
	
	// strlen, strcpy, strcat, strcmp, strstr
	printf(" %s 的长度: %d\n", s1, strlen(s1));
	// s2 = s1;
	strcpy(s2, s1);
	printf("s2 = %s\n", s2);
	
	strcat(s2, ps);
	printf("s2 = %s\n", s2);
	
	printf("s1 == s2? %d \n", strcmp(s1, s2));
	
	char *p = strstr(s2, "ll");
	printf("*p = %s\n", p);
	printf(" ll 在 %s 中的第%d个位置\n", s2, (p-s2));
	
	return 0;
}